<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>WIN32_FIND_DATA</title>
<meta http-equiv="Content-Type" Content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../../styles/styles.css">
<script language="javascript" src='../links.js' type="text/javascript"></script>
</head>
<body>

<h1>WIN32_FIND_DATA</h1>
<div class=navbar>
<a href="../index.html">main</a> |
<a href="../structures/index.html">structures</a> |
<a href="index.html">win32 structures</a>
</div>


<div class=shortdescr>
The <strong>WIN32_FIND_DATA</strong> structure describes a file found by the
<strong>FindFirstFile</strong>, <strong>FindFirstFileEx</strong>
or <strong>FindNextFile</strong> function.
</div>

<pre class=syntax>
typedef struct _WIN32_FIND_DATA {
  DWORD dwFileAttributes;
  FILETIME ftCreationTime;
  FILETIME ftLastAccessTime;
  FILETIME ftLastWriteTime;
  DWORD nFileSizeHigh;
  DWORD nFileSizeLow;
  DWORD dwReserved0;
  DWORD dwReserved1;
  TCHAR cFileName[ MAX_PATH ];
  TCHAR cAlternateFileName[ 14 ];
} WIN32_FIND_DATA;
</pre>

<h3>Members</h3>
<div class=descr>
    <div class=dfn>dwFileAttributes</div>
    <div class=dfndescr>Specifies the file attributes of the file found.
This member can be one or more of the following values.

       <table class="cont">
       <tr class="cont"><th class="cont" width="40%">Attribute</th><th class="cont" width="60%">Description</th></tr>
        <tr class="cont"><td class="cont" width="40%"><a name="FILE_ATTRIBUTE_ARCHIVE">FILE_ATTRIBUTE_ARCHIVE</a></td>
        <td class="cont" width="60%">The file or directory is an archive file or directory. Applications use this attribute to mark files for backup or removal.</td></tr>

        <tr class="cont"><td class="cont" width="40%"><a name="FILE_ATTRIBUTE_COMPRESSED">FILE_ATTRIBUTE_COMPRESSED</a></td>
        <td class="cont" width="60%">The file or directory is compressed. For a file, this means that all of the data in the file is compressed. For a directory, this means that compression is the default for newly created files and subdirectories.</td></tr>

        <tr class="cont"><td class="cont" width="40%"><a name="FILE_ATTRIBUTE_DIRECTORY">FILE_ATTRIBUTE_DIRECTORY</a></td>
        <td class="cont" width="60%">The handle identifies a directory.</td></tr>

        <tr class="cont"><td class="cont" width="40%"><a name="FILE_ATTRIBUTE_ENCRYPTED">FILE_ATTRIBUTE_ENCRYPTED</a></td>
        <td class="cont" width="60%">The file or directory is encrypted. For a file, this means that all data in the file is encrypted. For a directory, this means that encryption is the default for newly created files and subdirectories.</td></tr>

        <tr class="cont"><td class="cont" width="40%"><a name="FILE_ATTRIBUTE_HIDDEN">FILE_ATTRIBUTE_HIDDEN</a></td>
        <td class="cont" width="60%">The file or directory is hidden. It is not included in an ordinary directory listing.</td></tr>

        <tr class="cont"><td class="cont" width="40%"><a name="FILE_ATTRIBUTE_NORMAL">FILE_ATTRIBUTE_NORMAL</a></td>
        <td class="cont" width="60%">The file or directory has no other attributes set. This attribute is valid only if used alone.</td>
        </tr>

        <tr class="cont"><td class="cont" width="40%"><a name="FILE_ATTRIBUTE_OFFLINE">FILE_ATTRIBUTE_OFFLINE</a></td>
        <td class="cont" width="60%">The file data is not immediately available. This attribute indicates that the file data has been physically moved to offline storage.</td></tr>

        <tr class="cont"><td class="cont" width="40%"><a name="FILE_ATTRIBUTE_READONLY">FILE_ATTRIBUTE_READONLY</a></td>
        <td class="cont" width="60%">The file or directory is read-only. Applications can read the file but cannot write to it or delete it. In the case of a directory, applications cannot delete it.</td></tr>

        <tr class="cont"><td class="cont" width="40%"><a name="FILE_ATTRIBUTE_REPARSE_POINT">FILE_ATTRIBUTE_REPARSE_POINT</a></td>
        <td class="cont" width="60%">The file has an associated <a href="../dict.html#symboliclinks">reparse point</a>.</td></tr>

        <tr class="cont"><td class="cont" width="40%"><a name="FILE_ATTRIBUTE_SPARSE_FILE">FILE_ATTRIBUTE_SPARSE_FILE</a></td>
        <td class="cont" width="60%">The file is a <a href="../dict.html#sparsefile">sparse file</a>.</td></tr>

        <tr class="cont"><td class="cont" width="40%"><a name="FILE_ATTRIBUTE_SYSTEM">FILE_ATTRIBUTE_SYSTEM</a></td>
        <td class="cont" width="60%">The file or directory is part of the operating system or is used exclusively by the operating system.</td></tr>

        <tr class="cont"><td class="cont" width="40%"><a name="FILE_ATTRIBUTE_TEMPORARY">FILE_ATTRIBUTE_TEMPORARY</a></td>
        <td class="cont" width="60%">The file is being used for temporary storage. File systems attempt to keep all of the data in memory for quicker access, rather than flushing it back to mass storage. A temporary file should be deleted by the application as soon as it is no longer needed.</td></tr>

        <tr class="cont"><td class="cont" width="40%"><a name="FILE_ATTRIBUTE_NOT_CONTENT_INDEXED">FILE_ATTRIBUTE_NOT_CONTENT_INDEXED</a></td>
        <td class="cont" width="60%">The file or directory is not be indexed by the content indexing service.</td></tr>

        <tr class="cont"><td class="cont" width="40%"><a name="FILE_ATTRIBUTE_VIRTUAL">FILE_ATTRIBUTE_VIRTUAL</a></td>
        <td class="cont" width="60%">A file is a virtual file.</td></tr>
       </table>
    </div>

    <div class=dfn>ftCreationTime</div>
    <div class=dfndescr>
      A <a href="filetime.html">FILETIME</a> structure that specifies when the file or
directory was created. If the underlying file system does not support creation time,
<strong>ftCreationTime</strong> is zero.
    </div>

    <div class=dfn>ftLastAccessTime</div>
    <div class=dfndescr>A <a href="filetime.html">FILETIME</a> structure.
For a file, the structure specifies when the file was last read from or written to.
For a directory, the structure specifies when the directory was created.
For both files and directories, the specified date will be correct, but the time of day
will always be set to midnight. If the underlying file system does not support last
access time, <strong>ftLastAccessTime</strong> is zero.</div>

    <div class=dfn>ftLastWriteTime</div>
    <div class=dfndescr>A <a href="filetime.html">FILETIME</a> structure.
For a file, the structure specifies when the file was last written to.
For a directory, the structure specifies when the directory was created.
If the underlying file system does not support last write time, ftLastWriteTime is zero.</div>

    <div class=dfn>nFileSizeHigh</div>
    <div class=dfndescr>Specifies the high-order DWORD value of the file size, in bytes.
This value is zero unless the file size is greater than MAXDWORD.
The size of the file is equal to <code>(<var>nFileSizeHigh</var> * (1+MAXDWORD)) +
<var>nFileSizeLow</var></code>.</div>

    <div class=dfn>nFileSizeLow</div>
    <div class=dfndescr>Specifies the low-order DWORD value of the file size, in bytes.</div>

    <div class=dfn>dwReserved0</div>
    <div class=dfndescr>If the <var>dwFileAttributes</var> member includes the
<dfn>FILE_ATTRIBUTE_REPARSE_POINT</dfn> attribute, this member specifies the reparse tag.
Otherwise, this value is undefined and should not be used.
</div>

    <div class=dfn>dwReserved1</div>
    <div class=dfndescr>Reserved.</div>

    <div class=dfn>cFileName</div>
    <div class=dfndescr>A null-terminated string that is the name of the file.</div>

    <div class=dfn>cAlternateFileName</div>
    <div class=dfndescr>A null-terminated string that is an alternative name for the file.
This name is in the classic 8.3 (filename.ext) file name format.</div>

</div>

<h3>Remarks</h3>
<div class=descr>
<ul>
<li>If a file has a long file name, the complete name appears in the <var>cFileName</var>
field, and the 8.3 format truncated version of the name appears in the
<var>cAlternateFileName</var> field.
  Otherwise <var>cAlternateFileName</var> is empty.
  As an alternative, you can use the <a href="win32/GetShortPathName">GetShortPathName</a>
  function to find the 8.3 format version of a file name.
</li>
<li>Not all file systems can record creation and last access time
and not all file systems record them in the same manner. For example,
on NT FAT, create time has a resolution of 10 milliseconds, write time
has a resolution of 2 seconds, and access time has a resolution of 1 day
(really, the access date). On NTFS, access time has a resolution of 1 hour.
</li>
</ul>
</div>

<div class=see>See also:</div><div class=seecont>
<a href="../defs/_far_use_win32_find_data.html">_FAR_USE_WIN32_FIND_DATA</a>,
<a href="../defs/far_find_data.html">FAR_FIND_DATA</a>,
<a href="filetime.html">FILETIME</a>,
<a href="../delphi/twin32finddata.html">TWin32FindData</a>
</div>

</body>
</html>
